#include<iostream>
//#include<string>
//#include<cstdio>
//#include<cstring>
//#include<cmath>
//#include<algorithm>
using namespace std;

int fy(int n,int m)
{
    if (n==1) return 1;
    if (m==1) return 0;
    if (n%m==0) return fy(n,m-1)+fy(n/m,m);
	return fy(n,m-1);  
}

int main()
{
	int n,in;
	cin>>n;
	for (int i=1;i<=n;i++) {cin>>in;cout<<fy(in,in)<<endl;}
	
	return 0;
}